#include"process.h"

#include<unistd.h>

double total = 1024.0;

double rate = 0.5;

void download()
{
	double current = 0.0;
	while(current <= total)
	{
		flushprocess(current,total);
		// 模拟下载
		usleep(3000);
		current += rate;
	}
		flushprocess(current,total);
	printf("\n下载完毕，文件大小%.1fKB\n",total);
}

int main()
{
	download();
	return 0;
}
